package com.ctrip.demo.design.chain.upgrade;

import com.ctrip.demo.design.chain.common.PreparationList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class HaveBreakfastFilter implements StudyPrepareFilter {

    Logger logger = LoggerFactory.getLogger(HaveBreakfastFilter.class);
    @Override
    public void doFilter(PreparationList preparationList, FilterChain filterChain) {

        logger.info("HaveBreakfastFilter start");
        if (preparationList.isHaveBreakfast()) {
            System.out.println("吃完早饭");
        }

        filterChain.doFilter(preparationList, filterChain);
        logger.info("HaveBreakfastFilter end");

    }
}
